import com.pyg.pojo.TbSeller;
import com.pyg.shop.controller.SellerController;
import org.csource.fastdfs.*;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class test {

    public static void main(String[] args) {
        BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
        String newPwd = passwordEncoder.encode("123456");
        System.out.println(newPwd);
    }
    @Test
    public void testFastDfs() throws Exception {
        //加载配置文件,配置文件的内容就是tracker服务的地址
        ClientGlobal.init("E:\\workspace\\pyg-shop-web\\src\\main\\resources\\conf\\fdfs_client.conf");
        //创建一个TrackerClient对象
        TrackerClient trackerClient = new TrackerClient();
        //使用trackerClient对象创建连接
        TrackerServer trackerServer = trackerClient.getConnection();
        StorageServer storageServer = null;
        // 5、创建一个 StorageClient 对象，需要两个参数 TrackerServer 对象、StorageServer的引用
        StorageClient storageClient = new StorageClient(trackerServer,storageServer);
        // 6、使用 StorageClient 对象上传图片。
        //扩展名不带“.”
        String[] pngs = storageClient.upload_file("C:\\Users\\Administrator\\Desktop\\黄达\\zhao-master\\zhao-master\\data\\person\\项英\\portrait.png", "png", null);
        for (String string : pngs) {
            System.out.println(string);
        }

    }
}
